﻿using Microsoft.EntityFrameworkCore;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Security.AccessControl;
using System.Text;
using System.Threading.Tasks;

namespace WheelClean2.Model
{
    /// <summary>
    /// 激光运行轨迹
    /// </summary>
    public class Track : BindableBase
    {

        /// <summary>
        /// 序号
        /// </summary>
        [Key]  // 标识主键
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]  // 自增
        public int ID { get; set; }

        private int? _trackListNumber;
        /// <summary>
        /// 轨迹编号
        /// </summary>
        public int? TrackListNumber
        {
            get { return _trackListNumber; }
            set { SetProperty(ref _trackListNumber, value); }
        }
        private bool _isSelected;
        /// <summary>
        /// 是否被选中
        /// </summary>
        [NotMapped]
        public bool IsSelected
        {
            get { return _isSelected; }
            set { SetProperty(ref _isSelected, value); }
        }
        private int _number;
        /// <summary>
        /// 步号
        /// </summary>

        public int Number
        {
            get { return _number; }
            set { SetProperty(ref _number, value); }
        }
        private int? _functionCode;
        /// <summary>
        /// 功能码 1=X轴/2=Y轴/3=R轴/4=激光控制/5=激光参数设置/6=转轮速度设置/20=流程结束
        /// </summary>
        public int? FunctionCode
        {
            get { return _functionCode; }
            set { SetProperty(ref _functionCode, value); }
        }
        private string _functionName;
        /// <summary>
        /// 功能码解释 1=X轴/2=Y轴/3=R轴/4=激光控制/5=激光参数设置/6=转轮速度设置/20=流程结束
        /// </summary>
        public string FunctionName
        {
            get { return _functionName; }
            set { SetProperty(ref _functionName, value); }
        }
        private float? _data1;
        /// <summary>
        /// 数据1 轴目标位置(mm)/激光开关(1-0)/激光参数工艺库调取编号(1-99)
        /// </summary>
        public float? Data1
        {
            get { return _data1; }
            set { SetProperty(ref _data1, value); }
        }
        private float? _data2;
        /// <summary>
        /// 数据2 轴速度/转轮速度(单位mm/s)
        /// </summary>
        public float? Data2
        {
            get { return _data2; }
            set { SetProperty(ref _data2, value); }
        }

        private double? _time;
        /// <summary>
        /// 延时时间(单位S)
        /// </summary>
        public double? Time
        {
            get { return _time; }
            set { SetProperty(ref _time, value); }
        }
    }
}
